package org.ru.mse10.cvis.entity.fs;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.ru.mse10.cvis.entity.misc.Identity;

/**
 * The Class File.
 */
@Entity
@Table(name = "file")
public class File extends Identity implements Serializable {

	/**
	 * The Enum FileScanStatus.
	 */
	public enum FileScanStatus {

		/** The ok. */
		OK,
		/** The inected. */
		INECTED,
		/** The not scaned. */
		NOT_SCANED;
	}

	/** The name. */
	private String name;

	/** The mime type. */
	private String mimeType;

	/** The data. */
	private byte[] data;

	/** The scan status. */
	private FileScanStatus scanStatus;

	/**
	 * Gets the name.
	 * 
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name.
	 * 
	 * @param name
	 *            the new name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the mime type.
	 * 
	 * @return the mime type
	 */
	public String getMimeType() {
		return mimeType;
	}

	/**
	 * Sets the mime type.
	 * 
	 * @param mimeType
	 *            the new mime type
	 */
	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}

	/**
	 * Gets the data.
	 * 
	 * @return the data
	 */
	@Lob
	public byte[] getData() {
		return data;
	}

	/**
	 * Sets the data.
	 * 
	 * @param data
	 *            the new data
	 */
	public void setData(byte[] data) {
		this.data = data;
	}

	/**
	 * Gets the scan status.
	 * 
	 * @return the scan status
	 */
	public FileScanStatus getScanStatus() {
		return scanStatus;
	}

	/**
	 * Sets the scan status.
	 * 
	 * @param scanStatus
	 *            the new scan status
	 */
	public void setScanStatus(FileScanStatus scanStatus) {
		this.scanStatus = scanStatus;
	}

}
